import java.util.Arrays;

public class Solution1111 {
    public int[] maxDepthAfterSplit(String seq) {
        int max=0;
        int cur=0;
        for (char c : seq.toCharArray()) {
            if (c=='('){
                cur++;
                max=Math.max(max,cur);
            }else{
                cur--;
            }
        }
        int[] ans=new int[seq.length()];
        for (int i=0;i<seq.length();i++){
            if (seq.charAt(i)=='('){
                cur++;
                if (cur>max/2){
                    ans[i]=1;
                }
            }else{
                if (cur>max/2){
                    ans[i]=1;
                }
                cur--;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1111().maxDepthAfterSplit("(()())")));
    }
}
